<?php
	class ApplyAction extends BaseAction {
		/*
		public function __construct(){
			parent::__construct();
		}
		*/
		public function apply_list(){
			$m['is_del'] = 0;
			$m['status'] = 1;
			$list = D('company_apply')->where($m)->order('ctime desc')->findpage(20);
			foreach ($list['data'] as $k => &$v) {
				$v['pic'] = get_img_url($v['logo']);
				$v['text'] = mb_substr($v['text'],0,30,'utf-8');
			}
			$this->assign('list',$list);
			$this->display();
		}
		public function apply_info(){
			$m['aid'] = $_GET['aid'];
			$list = D('company_apply')->where($m)->find();
			//$da['check'] = $list['check']+1;
			//D('company_faxian')->where($m)->save($da);
			$list['pic'] = get_img_url($list['logo']);
			/*$hirings = D('hiring')->where(array('cid'=>$list['cid'],'is_del'=>0,'status'=>1))->order('updateline desc')->limit(5)->select();
			$list['hirings'] = $hirings;*/
			$this->assign('list',$list);
			$this->display();
		}
		public function add_people(){
			$map['phone'] = $_POST['phone'];
			$map['aid'] = $_POST['aid'];
			$re = D('company_apply_people')->where($map)->find();
			if($re){
				$this->error('该手机号已经报名过了！');
			}else{
				$data = $_POST;
				$data['ctime'] = time();
				$result = D('company_apply_people')->add($data);
				if($result){
					$this->success('报名成功！');
				}
			}
			
		}
	}
?>